<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="PLATFORM_CSS/app.v1.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
<script src="PLATFORM_JS/app.v2.js"></script>
<script src="__STATIC__/js/common.js"></script>

<link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<script src="ADMIN_JS/art_dialog.source.js"></script>
<script src="ADMIN_JS/iframe_tools.source.js"></script>
<script src="__STATIC__/bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" href="PLATFORM_CSS/app.v1.css" type="text/css" />
{include file="platform/controlCommonVariable" }
<style>
.dialog-box{
	width:95%;
	margin:20px  auto;
}


</style>
</head>
<body>
<div class="dialog-box">
	<div class="row padder-v">
		<div class="col-sm-7">
			<!-- <a href="{:__URL('PLATFORM_MAIN/Shop/addShopGroup')}"
				class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> 添加分组 </a> -->
		</div>
		<div class="col-sm-2">
			<input type="text" id='startDate' placeholder="请选择开始日期" class="input-sm form-control" onclick="WdatePicker()"/>
		</div>
		<div class="col-sm-2">
			<input type="text" id='endDate' placeholder="请选择结束日期" class="input-sm form-control"  onclick="WdatePicker()" />
		</div>
		<div class="col-sm-1">
			<button class="btn btn-sm btn-default" type="button" onclick="LoadingInfo(1)">搜索</button>
		</div>
	</div>
	<section class="panel panel-default">
		<table class="table table-striped b-light text-sm">
			<colgroup>
					<col width="3%">
					<col width="17%">
					<col width="15%">
					<col width="15%">
					<col width="15%">
					<col width="20%">
			</colgroup>
			<thead>
				<tr>
					<th><input type="checkbox"></th>
					<th class="left">用户名</th>
					<th class="center">用户状态</th>
					<th class="center">手机号</th>
					<th class="left">邮箱</th>
					<th class="center">注册时间</th>
				</tr>
			</thead>
			<tbody id="list">
				<tr></tr>
			</tbody>
		</table>
		<div class="padder-v b-t border-gray" style="padding-bottom: 30px;">
				<div class="col-sm-10"> </div>
				<div class="col-sm-2">新增注册人数：<span class="gray" id="reg_person"></span>人</div>
			</div>
		{include file="platform/page" /}
	</section>
</div>

<script type="text/javascript">
$(function(){
	LoadingInfo(1);
});

//查询用户列表
	function LoadingInfo(pageIndex) {
		var start_date = $("#startDate").val();
		var end_date = $("#endDate").val();
		var shop_id = $("#shop_id").val();
		$.ajax({
			type : "post",
			url : "{:__URL('PLATFORM_MAIN/statistics/userRegRecordsList')}",
			async : true,
			data : {
				"pageIndex" : pageIndex,"start_date":start_date,"end_date":end_date,"shop_id":shop_id},
			success : function(data) {
				var html = '';
				$("#total_count_num").text(data["total_count"]);
				$("#reg_person").text(data['total_count']);
				$("#page_count_num").text(data["page_count"]);
				$("#page_count").val(data["page_count"]);
				$("#pageNumber a").remove();
				if (data["data"].length > 0) {
					for (var i = 0; i < data["data"].length; i++) {
						html += '<tr>';
						html += '<td><input type="checkbox" name="sub" value="'+ data['data'][i]['uid']+'"></td>';
						html += '<td>' + data["data"][i]["user_name"] + '</td>';
						if(data["data"][i]["user_status"] == 1){
						html += '<td class="center" style="color:green">正常</td>';
						}else{
							html += '<td class="center color-red">锁定</td>';
						}
						if(data["data"][i]["user_tel"] == ''){
							html += '<td class="center">--</td>';	
						}else{
							html += '<td class="center">' + data["data"][i]["user_tel"] + '</td>';
						}
						if(data["data"][i]["user_email"] == ''){
							html += '<td class="left">--</td>';	
						}else{
							html += '<td class="left">' + data["data"][i]["user_email"] + '</td>';
						}
						
						html += '<td class="center">' + timeStampTurnTime(data["data"][i]["reg_time"]) + '</td>';
						html += '</tr>';
					}
				} else {
					html += '<tr class="center"><td colspan="6">暂无会员注册记录</td></tr>';
				}
				$("#list").html(html);
					var totalpage = $("#page_count").val();
			if (totalpage == 1) {
				changeClass("all");
			}
			var $html = pagenumShow(jumpNumber,totalpage,{$pageshow})
			$("#pageNumber").append($html);
			}
		});
	}
	$("#search_text").keypress(function(e){
		if(e.keyCode == 13){
			LoadingInfo(1);
		}
	});
	
</script>
</body>
</html>